package com.example.train_operate.util;

import com.example.train_operate.dto.UserDTO;

public class UserHolder {
    private static final ThreadLocal<UserDTO> us = new ThreadLocal<>();

    public static void saveUser(UserDTO userDTO){
        us.set(userDTO);
    }

    public static UserDTO getUser(){
        return us.get();
    }

    public static void removeUser(){
        us.remove();
    }
}
